<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="template.xhtml">
	<ui:define name="content">
	
		<f:metadata>  
		    <f:viewParam name="elementId" value="#{hotelAvailabilityBean.hotelAvailabilityId}" />  
		    <f:viewParam name="hotelId" value="#{hotelAvailabilityBean.hotelId}" /> 
		</f:metadata>

		<h2>Modifica disponibilità hotel "<h:outputText value="#{hotelAvailabilityBean.hotel.name}" />":</h2>
		    	
		    	<h:form>
			<p:panelGrid columns="2">
				<f:facet name="header">  
		        	Modifica elemento 
		    	</f:facet>
		    	
		    	<h:outputLabel value="Camera:" /> 
		    	<p:selectOneMenu value="#{hotelAvailabilityBean.hotelAvailability.roomId}" effect="fold">  
		            <f:selectItem itemLabel="Select One" itemValue="" />  
		            <f:selectItems var="rm" value="#{roomBean.allRooms}" itemLabel="#{rm.name}" itemValue="#{rm.id}" />  
		            <p:column>  
		                #{rm.name}
		            </p:column> 
		        </p:selectOneMenu>
		    	
		    	<h:outputLabel value="Data inizio:" />
		    	<p:calendar value="#{hotelAvailabilityBean.hotelAvailability.fromDate}" />
		    	
		    	<h:outputLabel value="Data fine:" />
		    	<p:calendar value="#{hotelAvailabilityBean.hotelAvailability.toDate}" />
		    	
		    	<h:outputLabel value="Posti disponibili:" />  
		    	<p:inputTextarea rows="1" value="#{hotelAvailabilityBean.hotelAvailability.remaining}"/>
		    	
		    	<h:outputLabel value="Prezzo:" />  
		    	<p:inputTextarea rows="1" value="#{hotelAvailabilityBean.hotelAvailability.price}"/>
		    	
		    	<f:facet name="footer"> 
		    	
		    		<center>
		    			<p:button outcome="manageHotelAvailability" value="Annulla" >
		    			<f:param name="hotelId" value="#{hotelAvailabilityBean.hotelId}" />  
		    			</p:button>
		    			<p:commandButton action="#{hotelAvailabilityBean.updateHotelAvailability}" value="Salva" />
		    		</center>
		    	
		    	</f:facet>
			
			</p:panelGrid>
			</h:form>
			<br />
			<p:messages showDetail="true" autoUpdate="true" closable="true" />

	</ui:define>
</ui:composition>
</html>